﻿@model HdipCricketClub.ViewModels.CompletedScorecardViewModel

@{
    ViewBag.Title = "DisplayScorecardBattedSecond";
}

@using (@Html.BeginForm())
{
    <fieldset>
     <br />
     <h2>Scorecard For :</h2>
     @Html.DisplayFor(ModelItem => Model.ScorecardFixture.Team.Club.ShortName) @Html.DisplayFor(ModelItem => Model.ScorecardFixture.Team.name)
     vs @Html.DisplayFor(ModelItem => Model.ScorecardFixture.Opponent.club_name) @Html.DisplayFor(ModelItem => Model.ScorecardFixture.Opponent.team_name)<br />
     Played at : @ViewBag.Location on @Html.DisplayFor(ModelItem => Model.ScorecardFixture.date)
     <br /><br />
     @ViewBag.Toss
     <br />
    </fieldset>
    <fieldset>
    <br />
    Innings of @Html.DisplayFor(ModelItem => Model.ScorecardFixture.Opponent.club_name)
    <br /><br />
        <table>
            <tr>
                <th></th>
                <th>
                    Name:
                </th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
         @foreach (var item in Model.OpponentBatsmen)
         {
            <tr>
                <td class="column_ids">
                     @Html.DisplayFor(modelItem => item.op_batsman_number)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.op_player_name)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.DismissalType.type)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.Member.InitialAndLastName)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.Member1.InitialAndLastName)
                 </td>
                 <td class="column_numbers">
                     @Html.DisplayFor(modelItem => item.op_batting_runs)
                 </td>
            </tr>
         }
            <tr>
                <td></td>
                <td></td>
                <td></td>
                
                <td>
                    Sub Total:
                </td>
                <td></td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentTotalBattingRuns)
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Byes:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentOtherDetail.byes)
                </td>
                 <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Leg Byes:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentOtherDetail.leg_byes)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Wides:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentOtherDetail.wides)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    No Balls:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentOtherDetail.no_balls)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Total Extras:
                </td>
                <td></td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentTotalExtras)
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Total:
                </td>
                <td></td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.OpponentTotalScore)
                </td>
            </tr>
        </table>
        <br />
        <table>
            <tr>
                <th>
                </th>
                <th>
                    Name:
                </th>
                <th>
                    Overs:
                </th>
                <th>
                    Maidens:
                </th>
                <th>
                    Runs:
                </th>
                <th>
                    Wickets:
                </th>
            </tr>
        @foreach (var item in Model.ClubBowlers)
        {
            <tr>
                <td class="column_ids">
                    @Html.DisplayFor(modelItem => item.bowler_number)
                </td>
                <td class="column_names">
                    @Html.DisplayFor(modelItem => item.Member.InitialAndLastName)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.overs)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.maidens)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.bowling_runs)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.wickets)
                </td>
            </tr>
        }
        </table>
    </fieldset>
    <fieldset>
    <br />
    Innings of @Html.DisplayFor(ModelItem => Model.ScorecardFixture.Team.Club.ShortName)
    <br /><br />
        <table>
            <tr>
                <th></th>
                <th>
                    Name:
                </th>
                <th></th>
                <th></th>
                <th></th>
                <th></th>
            </tr>
         @foreach (var item in Model.ClubBatsmen)
         {
            <tr>
                <td class="column_ids">
                     @Html.DisplayFor(modelItem => item.batsman_number)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.Member.InitialAndLastName)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.DismissalType.type)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.fielder_name)
                 </td>
                 <td class="column_names">
                     @Html.DisplayFor(modelItem => item.bowler_name)
                 </td>
                 <td class="column_numbers">
                     @Html.DisplayFor(modelItem => item.batting_runs)
                 </td>
            </tr>
         }
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Sub Total:
                </td>
                <td></td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubTotalBattingRuns)
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Byes:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubOtherDetail.byes)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Leg Byes:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubOtherDetail.leg_byes)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Wides:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubOtherDetail.wides)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    No Balls:
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubOtherDetail.no_balls)
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Total Extras:
                </td>
                <td></td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubTotalExtras)
                </td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td>
                    Total:
                </td>
                <td></td>
                <td class="column_numbers">
                    @Html.DisplayFor(ModelItem => Model.ClubTotalScore)
                </td>
            </tr>
        </table>
        <br />
        <table>
            <tr>
                <th>
                </th>
                <th>
                    Name:
                </th>
                <th>
                    Overs:
                </th>
                <th>
                    Maidens:
                </th>
                <th>
                    Runs:
                </th>
                <th>
                    Wickets:
                </th>
            </tr>
        @foreach (var item in Model.OpponentBowlers)
        {
            <tr>
                <td class="column_ids">
                    @Html.DisplayFor(modelItem => item.op_bowler_number)
                </td>
                <td class="column_names">
                    @Html.DisplayFor(modelItem => item.op_player_name)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.op_overs)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.op_maidens)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.op_bowling_runs)
                </td>
                <td class="column_numbers">
                    @Html.DisplayFor(modelItem => item.op_wickets)
                </td>
            </tr>
        }
        </table>
    </fieldset>
    <p>
        @Html.ActionLink("View another Scorecard", "ViewScorecard", "Scorecard")  |
        @Html.ActionLink("Return to Home Page", "Index", "Home")
    </p>
}